//
// Created by cljh on 2023/3/28.
//

#ifndef BIN_PACKING_INDIVIDUAL_H
#define BIN_PACKING_INDIVIDUAL_H


#include <vector>
#include "NestPath.h"
#include "Point.h"
#define _USE_MATH_DEFINES
#include <cmath>


class Individual{
public:
    std::vector<NestPath> paths;
    double fitness;
    std::vector<Vector> placement;
    double utilization;

    double getFitness(){
        return fitness;
    }
    Individual(std::vector<NestPath> _paths){
        paths=_paths;
        fitness=DBL_MIN;
    }
    Individual(std::vector<NestPath> _paths,double _fitness){
        paths=_paths;
        fitness=_fitness;
    }
    Individual(){
        paths=std::vector<NestPath>();
        fitness=DBL_MIN;
        placement=std::vector<Vector>();
    }
    int size(){
        return paths.size();
    }
    void push_back(NestPath path){
        paths.push_back(path);
    }
    NestPath &getPath(int index){
        return paths[index];
    }
    void setPath(NestPath path,int index){
        paths[index]=path;
    }
};

#endif //BIN_PACKING_INDIVIDUAL_H
